<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改费用报销')" />
	<link th:href="@{/flowable/flowable.css}" rel="stylesheet"/>
</head>
<body class="df-flow-body">
	<div class="df-flow-head">
		<div class="df-flow-head-icon"><i class="fa fa-desktop fa-2x" aria-hidden="true"></i></div>
		<div class="df-flow-head-btn">
			
		</div>
	</div>
    <div class="wrapper wrapper-content animated fadeInRight ibox-content white-bg df-flow-main">
    	<div class="df-flow-info">
    		
    	</div>
    	<div class="df-flow-content">
			<ul class="nav nav-tabs" role="tablist">
			    <li role="presentation" class="active"><a href="#formInfo" aria-controls="formInfo" role="tab" data-toggle="tab">表单信息</a></li>
			    <li role="presentation"><a href="#flowItems" aria-controls="flowItems" role="tab" data-toggle="tab">流程记录</a></li>
			    <li role="presentation"><a href="#flowImage" aria-controls="flowImage" role="tab" data-toggle="tab">流程图</a></li>
		  	</ul>
			<div class="tab-content">
			    <div role="tabpanel" class="tab-pane active" id="formInfo">
			    	<form class="form-horizontal m" id="form-expense-edit" th:object="${expense}">
						<input type="hidden" name="flowTypeId" th:field="*{flowTypeId}"/><!-- 流程类型ID -->
						<input type="hidden" name="deployId" th:field="*{deployId}"/><!-- 流程部署ID -->
						<input type="hidden" name="modelKey" th:field="*{modelKey}"/><!-- 流程模板标识 -->
						<input type="hidden" name="id" th:field="*{id}"/><!-- 主键ID -->
						<input type="hidden" name="businessKey" th:value="*{id}"/><!-- 业务ID == 主键ID-->
						<div class="form-group">	
							<label class="col-sm-1 control-label">报销标题：</label>
							<div class="col-sm-11">
								<input id="title" name="title" th:field="*{title}" class="form-control" placeholder="请输入标题" type="text" required="required">
							</div>
						</div>
						<div class="form-group">	
							<label class="col-sm-1 control-label">报销金额：</label>
							<div class="col-sm-11">
								<input id="money" name="money" th:field="*{money}" class="form-control" placeholder="请输入报销金额（单位：元）" type="text" required="required">
							</div>
						</div>
						<div class="form-group">
			                <label class="col-xs-1 control-label">报销清单：</label>
			                <div class="col-xs-11">
							    <textarea name="content" th:field="*{content}" maxlength="128" class="form-control" placeholder="请输入报销清单（0 ~ 128个字符）" rows="3"></textarea>
			                </div>
			            </div>
			            <div class="form-group">
							<label class="col-sm-1 control-label">备注：</label>
							<div class="col-sm-11">
								<textarea name="remark" th:field="*{remark}" maxlength="128" class="form-control" placeholder="请输入备注（0 ~ 128个字符）" rows="3"></textarea>
							</div>
						</div>
					</form>
			    </div>
			    <div role="tabpanel" class="tab-pane" id="flowItems"></div>
			    <div role="tabpanel" class="tab-pane" id="flowImage">
			    	<div class="wrapper wrapper-content animated fadeInRight ibox-content flowgrid">
						<img alt="流程图" src="" th:src="'/flowable/task/diagram/' + ${expense.id}" >
					</div>
			    </div>
  			</div>
		</div>
	</div>
    <th:block th:include="include :: footer" />
    <script th:src="@{/flowable/flowable.js}"></script><!-- 流程引擎js -->
    <script type="text/javascript">
        var prefix = ctx + "demo/expense";
		
		$("#form-expense-edit").validate({
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	flowEngine.actFormPost(prefix + '/edit', $('#form-expense-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
